

require(["config"], function(config) {
	require(["jquery","com","gv","move","swp"],function(jq,com,gv,move,swp) {
		//$(function(){
			/*var one = $(this).val()-1+1;
			$(".anniu1 .zhi").blur(function(){
				one = $(".anniu1 .zhi").val();
			})
			$(".anniu1 .jian").click(function(){
				if(one<=1){
					return;
				}
				one--;
				$(".anniu1 .zhi").val(one);
			})
			$(".anniu1 .jia").click(function(){
				one++;
				$(".anniu1 .zhi").val(one);
			})*/
		jq(function(){
			var one = 1;
			
			$(".anniu").hover(function(){
				one = $(this).find(".zhi").val();
				var two = $(this).next(".td5").find("span:nth(1)").text();
				$(this).find(".jia").click(function(){
					if(one>=5){
						$(this).find(".can").show();
						return;
					}
					one++;
					$(this).find(".zhi").val(one);
					three = one*two;
					$(this).next(".td5").find("span:nth(1)").text(three.toFixed(2));
					
				}.bind(this))
				
				$(this).find(".jian").click(function(){
					if(one<=1){
						return;
					}
					one--;
					$(this).find(".zhi").val(one);
					if(one<5){
						$(this).find(".can").hide();
					}
				}.bind(this))
			})
			
			/*删除*/
			jq("tr").hover(function(){
				$(this).find(".shanchu").click(function(){
					$(this).remove();
					if($(".num2").length==1){
						$(".num2").remove();
					}
					if($(".num1").length==1){
						$(".num1").remove();
					}
				}.bind(this))
			})
		})
		
		onload = function(){
			/*点击checkbox*/
			var one = document.getElementsByClassName("sum1")[0];
			var onecheck = one.children[0].children[0];
			var money = one.children[4].children[1];
			var two = document.getElementsByClassName("num2");
			var jiesuan = document.getElementById("jieguo");
			onecheck.onclick = function(){
				console.log(typeof money.innerHTML);
				if(onecheck.checked==true){
					jieguo.innerHTML = (money.innerHTML-1+1).toFixed(2);
				}else{
					jieguo.innerHTML = 0;
				}
			}
		}

		
		
		
		
		
	})	
})
